<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<script type="text/javascript">
			document.addEventListener('plusready', function() {
				//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。")

			});
		</script>
		<style>
			* {
				margin: 0;
			}

			#pdf-container {
				width: 100%;
				height: 100%;
			}
		</style>
	</head>
	<body>
		<div id="pdf-container"></div>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.js"></script>
		<script>
			// 指定工作线程脚本的路径
			pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.worker.js';
			// 获取容器元素
			var container = document.getElementById('pdf-container');
			pdfjsLib.getDocument('https://static.mo-yu.vip/oss/dfnwfwjfhw22222222.pdf').promise.then(function(pdf) {
				for (var i = 0; i <= pdf.numPages; i++) {
					pdf.getPage(i).then(function(page) {
						var scale = .7;
						var viewport = page.getViewport({
							scale: scale
						});
				
						// 创建一个<canvas>元素用于显示PDF页面
						var canvas = document.createElement('canvas');
						var context = canvas.getContext('2d');
						canvas.width = viewport.width;
						canvas.height = viewport.height;
				
						// 将PDF页面渲染到<canvas>元素中
						page.render({
							canvasContext: context,
							viewport: viewport
						});
				
						// 将<canvas>元素添加到容器中
						container.appendChild(canvas);
					});
				}
			});
		</script>
	</body>
</html>